-
Notifications
You must be signed in to change notification settings - Fork 31
Add filter_meta_array and change filter_arrays_by_meta to support more complex items_to_filter parameters by using filter_meta_array
#725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… into jg/add_functionality_to_filter_arrays_by_meta
| only_group = [{"group": "adj"}, {"group": "raw"}] | ||
| group_gen_anc_a = [{"group": "adj", "gen_anc": "a"}] | ||
| group_gen_anc_a_b = [*group_gen_anc_a, {"group": "adj", "gen_anc": "b"}] | ||
| group_gen_anc = [*group_gen_anc_a_b, {"group": "adj", "gen_anc": "c"}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this one be named "group_gen_anc_a_b_c" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after reading through, maybe just add a comment here to clarify since it breaks the pattern
| group_sex = [{"group": "adj", "sex": "XX"}, {"group": "adj", "sex": "XY"}] | ||
| group_subset = [ | ||
| {"group": "adj", "subset": "s1"}, | ||
| {"group": "raw", "subset": "s1"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just following the patterns of the others, should this actually be {"group": "adj", "subset": "s2"}?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or add comment to clarify
| {"group": "adj", "gen_anc": "b", "sex": "XY"}, | ||
| ] | ||
| group_gen_anc_a_b_sex = group_gen_anc_a_sex + group_gen_anc_b_sex | ||
| group_gen_anc_sex = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group_gen_anc_a_b_c_sex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment
| *group_gen_anc_a_subset, | ||
| {"group": "adj", "gen_anc": "b", "subset": "s1"}, | ||
| ] | ||
| group_gen_anc_subset = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group_gen_anc_a_b_c_subset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment
| group_gen_anc_a_b_sex_subset = ( | ||
| group_gen_anc_a_sex_subset + group_gen_anc_b_sex_subset | ||
| ) | ||
| group_gen_anc_sex_subset = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group_gen_anc_a_b_c_sex_subset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment
| combine_operator: str, | ||
| exact_match: bool, | ||
| expected: str, | ||
| metadata_combinations: Any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does metadata_combinations refer to?
| expected_meta: List[Dict[str, str]], | ||
| expected_expr1: List[int], | ||
| expected_expr2: List[int], | ||
| ) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add params
| (s_ga_list, False, *all_and, False, "no_sex_and_no_gen_anc"), | ||
| (s_ga_ex, True, *all_and, False, "no_sex_and_no_gen_anc"), | ||
| (["sex", "subset"], True, "or", "and", "and", False, "sex_or_subset"), | ||
| (ss_d_list, False, *all_and, False, "no_subset_and_no_downsampling"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should only exclude if both subset and downsampling are present?
| exact_match: bool, | ||
| expected_meta: str, | ||
| metadata_combinations: Any, | ||
| ) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add params
| filtering criteria for keys/key-value pairs to exclude. | ||
| :param combine_operator: Whether to use "and" or "or" to combine the keep and | ||
| exclude filtering criteria. | ||
| :param exact_match: Whether to apply the filtering only to items with exactly the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clarify that this only relates to the "keep" items
I still need to add tests for the added function and modified function